<template>
  <div>
    <div class="deng-da">
      <p class="deng-1">登录账号</p>
      <p class="deng-2">虾米 - 严选商城欢迎您</p>
      <p class="deng-3">
        <!-- <input type="text" placeholder="手机号码"> -->
        <input v-model="str" type="number" @blur="onblur()" placeholder="请输入手机号" max="11" />
        <span>必填</span>
        <span class="you">
          <van-icon name="phone-o" />
        </span>
      </p>
      <p class="deng-3">
        <input type="text" placeholder="密码" v-show="isShow" v-model="password" />
        <input type="password" placeholder="密码" v-show="!isShow" v-model="inputvalue" />
        <span>必填</span>
        <span class="you" v-show="!isShow" @click="dain" style="cursor: pointer;">
          <van-icon name="closed-eye" />
        </span>
        <span class="you" v-show="isShow" @click="dian" style="cursor: pointer;">
          <van-icon name="eye-o" />
        </span>
      </p>
      
      <div>
        <span class="deng" @click="dl">登录</span>
      </div>
      <div class="ce" @click="tow">
        <p class="deng-4">忘记密码</p>
      </div>

      <div class="ce" @click="to">
        <p class="deng-5">还没有注册？立即注册</p>
      </div>
    </div>
  </div>
</template>
<script>
import phone from "../utils/phone";
export default {
  data() {
    return {
      isShow: false,
      phoneValue: false,
      password: "",
      inputvalue: "",
      str: "",
      getGrap: []
    };
  },
  methods: {
    onblur() {
      this.phoneValue = phone.animate(this.str);
    },
    to() {
      this.$router.push({
        path: "/ce"
      });
    },
    tow() {
      this.$router.push({
        path: "/wang"
      });
    },
    dain() {
      this.isShow = true;
      this.password = this.inputvalue;
    },
    dian() {
      this.isShow = false;
      this.inputvalue = this.password;
    },
    dl(){
      this.$router.push({
        path:'/my',
        query:{
          id:this.str
        }

      })
    }
  }
};
</script>

<style scoped>
* {
  margin: 0;
  padding: 0;
}
.deng-da {
  width: 90%;
  height: 9rem;
  border: 1px solid #eee;
  margin: 0 auto;
  margin-top: 0.5rem;
}
.deng-1 {
  font-size: 0.4rem;
  margin-top: 0.44rem;
  margin-left: 0.5rem;
}
.deng-2 {
  font-size: 0.25rem;
  margin-top: 0.44rem;
  margin-left: 0.5rem;

  color: gray;
}
.deng-3 {
  width: 5rem;
  height: 0.86rem;
  border-radius: 0.12rem;
  background: #f5f5f5;
  /* border: 1px solid red; */
  margin-top: 0.44rem;
  margin-left: 0.5rem;
}
.deng-3 input {
  outline: none;
  border: 0rem solid red;
  /* line-height: 0.76rem; */
  margin-top: 0.27rem;
  background: #f5f5f5;
  margin-left: 0.1rem;
}
.deng {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  padding-left: 1.2rem;
  padding-right: 1.2rem;
  border-radius: 0.1rem;
  color: white;
  background: linear-gradient(135deg, #e570e7 0%, #79f1fc 100%);
  position: relative;
  top: 1rem;
  left: 1.6rem;
}
.ce {
  position: relative;
  top: 1.5rem;
  left: 1.6rem;
}
.deng-4 {
  color: gray;
  font-size: 0.2rem;
  margin-left: 1rem;
}
.deng-5 {
  color: #549ff9;
  margin-left: 0.2rem;
  margin-top: 0.5rem;
}
.you {
  padding-left: 0.5rem;
}
.ce-4 {
  width: 5rem;
  height: 0.86rem;
  border-radius: 0.12rem;
  background: #f5f5f5;
  /* border: 1px solid red; */
  margin-top: 0.44rem;
  margin-left: 0.5rem;
}
.ce-4 input {
  width: 1.5rem;
  outline: none;
  border: 0rem solid red;
  /* line-height: 0.76rem; */
  margin-top: 0.27rem;
  background: #f5f5f5;
  margin-left: 3rem;
}
</style>